using System;
using System.IO;

namespace Microsoft.Coding4Fun.TweetCraft.Tray.Support
{
	/// <summary>
	/// Defines contract for controlling http based downloads. 
	/// </summary>
	public interface IDownloadManager: IDisposable
	{
		/// <summary>
		/// Downloads the specified file from the given url in asynchronous way.
		/// </summary>
		/// <param name="uri">The URL.</param>
		/// <param name="completedCallback">The completed callback.</param>
		void DownloadFile(Uri uri, Action<Stream, Exception> completedCallback);

		/// <summary>
		/// Downloads the specified file from the web and return content as string.
		/// </summary>
		/// <param name="uri">The URI.</param>
		/// <param name="completedCallback">The completed callback.</param>
		void DownloadFileAsString(Uri uri, Action<string, Exception> completedCallback);
	}
}